package com.orange.common.base

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.drake.statelayout.Status

open class BaseViewModel : ViewModel() {

    private val _uiState = MutableLiveData(Status.CONTENT)
    val uiState: LiveData<Status> = _uiState

    fun showLoading() {
        _uiState.value = Status.LOADING
    }

    fun showEmpty() {
        _uiState.value = Status.EMPTY
    }

    fun showError() {
        _uiState.value = Status.ERROR
    }

    fun showContent() {
        _uiState.value = Status.CONTENT
    }
}